package cn.caplike.demo.netty;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;

/**
 * @author LiKe
 * @version 1.0.0
 * @date 2022-11-17 12:39
 */
public class CompositeByteBuf {

    public static void main(String[] args) {
        io.netty.buffer.CompositeByteBuf compositeByteBuf = Unpooled.compositeBuffer();

        ByteBuf heapByteBuf = Unpooled.buffer(10);
        ByteBuf directByteBuf = Unpooled.directBuffer(8);

        compositeByteBuf.addComponents(heapByteBuf, directByteBuf);
        //compositeByteBuf.removeComponent(0);

        for (ByteBuf byteBuf : compositeByteBuf) {
            System.out.println(byteBuf);
        }
    }
}
